package com.shushan.pages.bean;

import com.android.net.bean.NetBaseBean;
import com.shushan.mixedexam.bean.ExerciseResultBean;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * @ClassName: PaperInfoBean
 * @Desciption: //试卷信息bean
 * @author: zhangshihao
 * @date: 2018-04-24
 */
public class PaperInfoBean extends NetBaseBean {

    public int id;
    public int video_id;
    public int special_id;
    public int outline_id;
    public int time_consuming;//消耗时间
    public int chinese_score;//小于等于0都没有分数
    public int math_score;
    public int english_score;

    public ExerciseResultBean exerciseResultBean;

    @Override
    public void initByJson(JSONObject jsonObject) throws JSONException {
        if(jsonObject != null){
            id = jsonObject.optInt("id");
            video_id = jsonObject.optInt("video_id");
            special_id = jsonObject.optInt("special_id");
            outline_id = jsonObject.optInt("outline_id");
            time_consuming = jsonObject.optInt("time_consuming");
            chinese_score = jsonObject.optInt("chinese_score");
            math_score = jsonObject.optInt("math_score");
            english_score = jsonObject.optInt("english_score");

            JSONObject resultObj = jsonObject.optJSONObject("answer_result");
            exerciseResultBean = new ExerciseResultBean();
            exerciseResultBean.initByJson(resultObj);
        }
    }
}
